package com.kevin.v2.spring.formework.context.support;

import com.kevin.v2.spring.formework.beans.config.KvBeanDefinition;
import lombok.extern.slf4j.Slf4j;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

/**
 * 用于ioc 初始化的实现
 */
@Slf4j
public class KvDefaultListableBeanFactory extends KvAbstractApplicationContext {

   //伪IOC容器 存放扫描到的bean的定义
   protected Map<String, KvBeanDefinition> beanDefinitionMap = new HashMap<>();



//    public   Object [] ArrayBeanNames(){
//      return beanDefinitionMap.keySet().toArray();
//   }
   public String[] getBeanDefinitionNames() {
      return this.beanDefinitionMap.keySet().toArray(new  String[this.beanDefinitionMap.size()]);
   }

   public static void main (String[] args) {
      Map<String, String> map = new HashMap<>();
      map.put("1", "1");
      map.put("2", "1");
      map.put("3", "1");
      Object[] list = map.keySet().toArray();
      System.out.println(Arrays.toString(list));
   }

}
